﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
                    xmlns:tk="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
                    xmlns:phoney="clr-namespace:AgiliTrain.PhoneyTools.Controls;assembly=AgiliTrain.PhoneyTools"
                    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                    mc:Ignorable="d">
  <ResourceDictionary.MergedDictionaries>
    <ResourceDictionary Source="Brushes.xaml" />
    <ResourceDictionary Source="Colors.xaml" />
  </ResourceDictionary.MergedDictionaries>
  <!-- Resource dictionary entries should be defined here. -->
  <Style x:Key="StrechyItemStyle"
         TargetType="ListBoxItem">
    <Setter Property="Background"
            Value="Transparent" />
    <Setter Property="BorderThickness"
            Value="0" />
    <Setter Property="BorderBrush"
            Value="Transparent" />
    <Setter Property="Padding"
            Value="0" />
    <Setter Property="HorizontalContentAlignment"
            Value="Left" />
    <Setter Property="VerticalContentAlignment"
            Value="Top" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="ListBoxItem">
          <Border x:Name="LayoutRoot"
                  BorderBrush="{TemplateBinding BorderBrush}"
                  BorderThickness="{TemplateBinding BorderThickness}"
                  Background="{TemplateBinding Background}"
                  HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
                  VerticalAlignment="{TemplateBinding VerticalAlignment}">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal" />
                <VisualState x:Name="MouseOver" />
                <VisualState x:Name="Disabled">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background"
                                                   Storyboard.TargetName="LayoutRoot">
                      <DiscreteObjectKeyFrame KeyTime="0"
                                              Value="{StaticResource TransparentBrush}" />
                    </ObjectAnimationUsingKeyFrames>
                    <DoubleAnimation Duration="0"
                                     To=".5"
                                     Storyboard.TargetProperty="Opacity"
                                     Storyboard.TargetName="ContentContainer" />
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="SelectionStates">
                <VisualState x:Name="Unselected" />
                <VisualState x:Name="Selected">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground"
                                                   Storyboard.TargetName="ContentContainer">
                      <DiscreteObjectKeyFrame KeyTime="0"
                                              Value="{StaticResource PhoneAccentBrush}" />
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <ContentControl x:Name="ContentContainer"
                            ContentTemplate="{TemplateBinding ContentTemplate}"
                            Content="{TemplateBinding Content}"
                            Foreground="{TemplateBinding Foreground}"
                            Margin="{TemplateBinding Padding}"
                            VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                            HorizontalContentAlignment="Stretch" />
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <ControlTemplate x:Key="PhoneDisabledTextBoxTemplate"
                   TargetType="TextBox">
    <ContentControl x:Name="ContentElement"
                    BorderThickness="0"
                    HorizontalContentAlignment="Stretch"
                    Margin="{StaticResource PhoneTextBoxInnerMargin}"
                    Padding="{TemplateBinding Padding}"
                    VerticalContentAlignment="Stretch" />
  </ControlTemplate>
  <ControlTemplate x:Key="PhoneDisabledPasswordBoxTemplate"
                   TargetType="PasswordBox">
    <Border x:Name="ContentElement"
            BorderThickness="0"
            Margin="{StaticResource PhonePasswordBoxInnerMargin}"
            Padding="{TemplateBinding Padding}" />
  </ControlTemplate>
  <Style x:Key="theSelectSwitch"
         TargetType="phoney:SelectSwitch">
    <Setter Property="Background"
            Value="{StaticResource TransparentBrush}" />
    <Setter Property="BorderBrush"
            Value="{StaticResource PhoneBorderBrush}" />
    <Setter Property="Foreground"
            Value="{StaticResource PhoneForegroundBrush}" />
    <Setter Property="IndicatorBrush"
            Value="{StaticResource PhoneAccentBrush}" />
    <Setter Property="TextIndicatorFontSize"
            Value="{StaticResource PhoneFontSizeSmall}" />
    <Setter Property="TextIndicatorFontFamily"
            Value="Segoe WP Light" />
    <Setter Property="TextIndicatorFontWeight"
            Value="Normal" />
    <Setter Property="TextIndicatorFontStretch"
            Value="Condensed" />
    <Setter Property="TextIndicatorBrush"
            Value="{StaticResource PhoneForegroundBrush}" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="phoney:SelectSwitch">
          <Grid Background="{TemplateBinding Background}"
                d:DesignWidth="470"
                d:DesignHeight="70"
                MinHeight="85"
                MinWidth="100">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="SwitchStates">
                <VisualState x:Name="OnState">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)"
                                                   Storyboard.TargetName="indicatorLight">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="OffState" />
              </VisualStateGroup>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="NormalState" />
                <VisualState x:Name="DisabledState">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)"
                                                   Storyboard.TargetName="disabledFrame">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="Auto"
                                MinWidth="80" />
              <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <ContentPresenter Grid.Column="1"
                              Margin="{TemplateBinding Margin}"
                              Content="{TemplateBinding Content}"
                              HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
                              VerticalAlignment="{TemplateBinding VerticalAlignment}" />
            <Grid x:Name="Switch"
                  Background="{StaticResource TransparentBrush}"
                  MinWidth="68">
              <Rectangle RadiusY="3.75"
                         RadiusX="3.75"
                         Margin="8"
                         Fill="{StaticResource appBarBrush}" />
              <Rectangle RadiusY="3.75"
                         RadiusX="3.75"
                         StrokeThickness="0.2"
                         Margin="8"
                         Stroke="{TemplateBinding BorderBrush}" />
              <Rectangle x:Name="indicatorLight"
                         Margin="14,16,14,0"
                         RadiusY="3.75"
                         RadiusX="3.75"
                         StrokeThickness="0.5"
                         Height="8"
                         VerticalAlignment="Top"
                         Fill="{TemplateBinding IndicatorBrush}"
                         Visibility="Collapsed" />
              <Rectangle x:Name="indicatorFrame"
                         Margin="14,16,14,0"
                         RadiusY="3.75"
                         RadiusX="3.75"
                         StrokeThickness="0.5"
                         Height="8"
                         VerticalAlignment="Top">
                <Rectangle.Stroke>
                  <RadialGradientBrush RadiusY="1.096"
                                       RadiusX="1.019"
                                       Center="0.195,-0.098"
                                       GradientOrigin="0.265,0.15">
                    <GradientStop Color="Black"
                                  Offset="0.689" />
                    <GradientStop Color="White"
                                  Offset="1" />
                  </RadialGradientBrush>
                </Rectangle.Stroke>
              </Rectangle>
              <TextBlock x:Name="TextIndicator"
                         Margin="14,12,14,0"
                         Text="on"
                         FontFamily="Segoe WP Light"
                         FontSize="{StaticResource PhoneFontSizeSmall}"
                         TextAlignment="Center"
                         HorizontalAlignment="Center"
                         VerticalAlignment="Center"
                         Foreground="{TemplateBinding Foreground}" />
              <Rectangle x:Name="disabledFrame"
                         RadiusY="3"
                         RadiusX="3"
                         StrokeThickness="0.2"
                         Margin="8"
                         Opacity="0.9"
                         Visibility="Collapsed"
                         Stroke="{StaticResource PhoneChromeBrush}">
                <Rectangle.Fill>
                  <SolidColorBrush Color="{StaticResource PhoneChromeColor}" />
                </Rectangle.Fill>
              </Rectangle>
            </Grid>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
</ResourceDictionary>